$(function(){
	
	var $btnSave = $('#btnSave');
	$btnSave.click(function(){
		keywordsSave();
	});
	
});

function keywordsSave(){
	
	var $id 		= $('#hd_id');
	var $plantform_id= $('#plantform_id');
	var $url 		= $('#url');
	var $title 		= $('#title');
	var $keywords 	= $('#keywords');
	var $description= $('#description');
    var $remark     = $('#remark');
    var $sort= $('#sort');

	var plantform_id= $plantform_id.val();
	var id			= $id.val();
	var url 		= $url.val();
	var title 		= $title.val();
	var keywords 	= $keywords.val();
	var description = $description.val();
    var remark      = $remark.val();
	var disabled	= $("input[name='disabled']:checked").val();
    var sort        = $sort.val();

	var params = {
		'id':id,
		'plantform_id':plantform_id,
		'url':url,
		'title':title,
		'keywords':keywords,
		'description':description,
        'remark':remark,
		'disabled':disabled,
        'sort':sort
	}

	$.post('/index.php/Admin/Keywords/update',params,function(data){
		if(data.success){
			alert('保存修改成功');
			
			location.href = '/index.php/Admin/Keywords/index';
		}else{
			alert('保存修改失败');
		}
	},'json');
}